package com.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.project.bean.ProductResultBean;
import com.project.mapper.IProductResultMapper;
import com.project.service.ProductResultService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ProductResultServiceImpl implements ProductResultService {
      @Autowired
      private IProductResultMapper mapper;
      @Override
      public List<ProductResultBean> findAll(String productNum) {
            QueryWrapper<ProductResultBean> qw=new QueryWrapper<>();
            if(productNum!=null&&!productNum.equals("")){
                  qw.eq("productNum",productNum);
            }
            return mapper.selectList(qw);
      }
      
      @Override
      public void add(ProductResultBean productResultBean) {
            mapper.insert(productResultBean);
      }
}
